package com.pat.web.services;

import com.pat.web.model.NoteRecord;

public class RecordService {

	/**
	 * 判断手帐记录是否归属于当前用户
	 * 
	 * @param recordId
	 * @param userId
	 * @return
	 */
	public static NoteRecord recordBelong(long recordId, long userId) {
		// 判断该手帐是否为该用户手帐
		NoteRecord record = NoteRecord.dao.findFirst(
				"select nr.* from note_record nr join note n on nr.note_id = n.id where n.user_id = ? and nr.id = ?",
				userId, recordId);
		if (record != null) {
			return record;
		}
		return null;
	}
}
